%h5= _('Email notifications')

.form-group.gl-mb-3
  = f.gitlab_ui_checkbox_component :emails_enabled,
      s_('GroupSettings|Enable email notifications'),
      checkbox_options: { checked: @group.emails_enabled?, disabled: !can_disable_group_emails?(@group) },
      help_text: s_('GroupSettings|Enable sending email notifications for this group and all its subgroups and projects')
  .gl-px-7
    = f.gitlab_ui_checkbox_component :show_diff_preview_in_email,
        s_('GroupSettings|Include diff previews'),
        checkbox_options: { checked: @group.show_diff_preview_in_email? & @group.emails_enabled?,
                          disabled: !@group.emails_enabled? || !can_set_group_diff_preview_in_email?(@group) },
        help_text: s_('GroupSettings|Emails are not encrypted. Concerned administrators may want to disable diff previews.')

= render 'groups/settings/resource_access_token_notify_inherited_settings', f: f
